home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
util4
/
0utils.lha
/
0Utils
/
wb_Update.data
< prev
next >
Wrap
Text File
|
1995-08-19
|
2KB
|
90 lines
#ifdef TPLTER
wb_Update = {
Short = {{ Notify WB about Icon image changes }};
DESCRIPTION = {{
Notify Workbench about a modified or newly
created icon. (we cannot notify it about
renames or about deletions!)
}};
BUGS = {{
Since Amiga is multitasking, it _is_ possible, that an iconfile
is created, after we have checked for its existance, and we
delete it while erasing our fake DefIcon ... (but hey, U should
call this command only _after_ creating Your files ...)
}};
TODO = {{
wildcards (this should be part of ReadArgs)
}};
HISTORY = {{
12-02-95 b_noll created
20-02-95 b_noll restructured source
21-02-95 b_noll added version/format-prefix/offset
20-03-95 b_noll added args diagnostics
18-05-95 b_noll created WB_Update from WB_Delete srcs
19-08-95 b_noll created .data file
}};
Libraries = { Icon; };
Includes = { "<string.h>" };
Template = "FILE/M/A,ONLYICONS/S";
Arguments = {{
STRPTR* file;
ULONG onlyIcons;
}};
version = "1.2";
body = {{
long cnt;
UBYTE buffer [MAXPATHLEN];
BPTR lock;
struct DiskObject *dob;
//if (IconBase = OpenLibrary(ICONNAME, 37)) {
retval = RETURN_OK;
for (cnt = 0; argv->file[cnt] && !retval; ++cnt) {
buffer[0] = 0;
strcat (buffer, argv->file[cnt]);
PutStr(buffer);
if ((dob = GetDiskObject(buffer))) {
if (!PutDiskObject(buffer,dob))
PrintFault(IoErr(), "...failed");
else
PutStr ("...done\n");
FreeDiskObject(dob);
} else if (!argv->onlyIcons && (dob = GetDiskObjectNew(buffer))) {
if (!PutDiskObject(buffer,dob))
PrintFault(IoErr(), "...failed");
else
PutStr ("...faked\n");
FreeDiskObject(dob);
strcat (buffer, ".info");
DeleteFile (buffer);
} else {
PrintFault(IoErr(), "...failed");
retval = RETURN_ERROR;
} /* if */
} /* for */
// CloseLibrary (IconBase);
//} /* if */
}};
};
#endif